home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 21 / Mac Magazin and MacEasy Magazine CD - Issue 21.iso / Spiele & Edutainment / Sokoban 3D 1.0 ƒ / Docs / Write your own levels < prev   
Text File  |  1996-03-18  |  3KB  |  54 lines

  1. Writing Your Own Levels For Sokoban 3D
  2.  
  3. Making Set Files
  4.      The levels in Sokoban 3D are organized into sets. Each set that isn't built in to the game has its own set file. I haven't yet written a level editor but if you're handy with ResEdit, you can make your own set files.
  5.      The set files consist of two resource types:
  6.      •The first is a standard 'TEXT' resource type which contains a bunch of text resources -- one for each level. You can (optionally) give each 'TEXT' resource a name which will be used as the name of the level by Sokoban 3D. The 'TEXT' resources are layed out according to the standard Sokoban level file format which uses ASCII characters to represent floors, walls, boxes, etc. See below for a description of this layout.
  7.      •The second resource type is the 'SETs' resource type which gives the name of the set and the resource ID's of the first and last levels. These resource ID's refer to the ID's of the corresponding 'TEXT' resources. A ResEdit template for the 'SETs' resource can be found in the Sokoban 3D game. The 'SETs' resource itself should have an ID of 128 and there should only be one 'SETs' resource per set file.
  8.      The set file should have a creator of 'Sk3d' and a type of 'Sets'.
  9.      Once you've succesfully made a set file and double-checked it against the information given here, drag it into the "Sets ƒ" folder in Sokoban 3D. The next time you start Sokoban, it should appear in the "Sets" menu.
  10.  
  11. Making Levels
  12.      Here's the layout of the TEXT resources that specify each level. This is a standard layout used by most implementations of Sokoban.
  13.      Each "cell" in the level (each square in the grid when viewed from the top-down as, e.g. in the "Map Mode" in Sokoban 3D), is represented by a single ASCII character. These characters are organized into lines separated by return characters. The top-most line refers to the top-most row of squares in the grid and so on.
  14.     The ASCII character codes are as follows:
  15.  
  16.      ' ' (space):                Floor
  17.      '#' (pound):              Wall
  18.      '$' (dollar sign):       Box
  19.      '.' (period):               Pallette
  20.      '@' ("at" symbol):     Player
  21.      '*' (asterisk):          Box on a pallette
  22.      '+': (plus):                Player on a pallette
  23.  
  24.      There must only be one player per level (either '@' or '+'). The level playing area should be completely surrounded by walls. The number of rows should bot exceed 32 and neither should the number of columns.
  25.      Here's an example (this is the first level from the original set of 50 levels):
  26.  
  27.     #####
  28.     #   #
  29.     #$  #
  30.   ###  $##
  31.   #  $ $ #
  32. ### # ## #   ######
  33. #   # ## #####  ..#
  34. # $  $          ..#
  35. ##### ### #@##  ..#
  36.     #     #########
  37.     #######
  38.  
  39. Notice that you don't need to add spaces to the end of a row if you've reached the end of the board but you must add spaces to the beginning to make sure everything lines up correctly.
  40.      When you add the 'TEXT' resource to ResEdit, it might be confusing since it may use a variable-width font. For instance, the above example could look like:
  41.  
  42.     #####
  43.     #   #
  44.     #$  #
  45.   ###  $##
  46.   #  $ $ #
  47. ### # ## #   ######
  48. #   # ## #####  ..#
  49. # $  $          ..#
  50. ##### ### #@##  ..#
  51.     #     #########
  52.     #######
  53.  
  54. So it's probably best to design your levels in a fixed-width font like Monaco or Courier and then import them to ResEdit by copying and pasting.